import pandas as pd


# 处理csv
rcs = pd.read_csv('/Users/yujiahao/02_Xizhi/日常学习（私人勿动）/code/My_Python/input/nba.csv')

# print(df.to_string())#全部输出
# print(df)#输出结果为数据的前面 5 行和末尾 5 行，中间部分以 ... 代替。

top_10 = rcs.head(10)

print(top_10)
# 将数据存成json
top_10.to_json('/Users/yujiahao/02_Xizhi/日常学习（私人勿动）/code/My_Python/input/nba.json')
top_10.to_json(orient='records', lines=True,path_or_buf='/Users/yujiahao/02_Xizhi/日常学习（私人勿动）/code/My_Python/input/rownba.json')



new_csv = pd.DataFrame (rcs ).to_csv('/Users/yujiahao/02_Xizhi/日常学习（私人勿动）/code/My_Python/input/new_nba.csv')

print(rcs.info())